package com.study.system.service;

import com.study.system.entity.Post;
import com.study.system.mapper.PostMapper;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class PostService {

    @Resource
    private PostMapper postMapper;

    /**
     * 获取所有职位名称
     *
     * @return 职位名称列表
     */
    public List<Post> getPostNames() {
        return postMapper.getPostNames();
    }

    /**
     * 修改用户职位
     * 
     * @param userId 用户ID
     * @param clubId 社团ID
     * @param postId 职位Id
     * @return 操作结果
     */
    public Boolean modifyUserPost(Integer userId, Integer clubId, Integer postId) {
        return postMapper.modifyUserPost(userId, clubId, postId) != 0;
    }

}
